package com.neusoft.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.neusoft.model.ItemSearch;
import com.neusoft.po.Item;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 商品DAO
 *
 * @author Lucifer
 * @since 2021/5/15 23:04
 */
@Repository
public interface ItemMapper extends BaseMapper<Item> {

    List<Item> list(ItemSearch itemSearch);

    List<Item> getWithComments(@Param("ids") Integer[] ids);

    Integer setNullSale(@Param("ids") Integer[] ids);

    Integer setNullFullless(@Param("ids") Integer[] ids);

    Integer setSale(@Param("ids") Integer[] item_ids, @Param("sale_id") Integer sale_id);

    Integer setFullless(@Param("ids") Integer[] item_ids, @Param("fullless_id") Integer sale_id);

    List<Item> supple(@Param("ids") List<Integer> item_ids, @Param("need") Integer need);
}
